package com.to_door_recycle.model.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 积分来源表
 * @TableName integral_source
 */
@TableName(value ="integral_source")
@Data
public class IntegralSource implements Serializable {
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 获取方式
     */
    @TableField(value = "source_way")
    private String sourceWay;

    /**
     * 回收物品名称
     */
    @TableField(value = "order_item_name")
    private String orderItemName;

    /**
     * 回收物品规格
     */
    @TableField(value = "order_item_specification")
    private String orderItemSpecification;

    /**
     * 下单项物品id
     */
    @TableField(value = "order_item_id")
    private Long orderItemId;

    /**
     * 积分获取时间
     */
    @TableField(value = "acquire_time")
    private Date acquireTime;

    /**
     * 来源积分数量
     */
    @TableField(value = "acquire_count")
    private Integer acquireCount;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    private Date updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        IntegralSource other = (IntegralSource) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getSourceWay() == null ? other.getSourceWay() == null : this.getSourceWay().equals(other.getSourceWay()))
            && (this.getOrderItemName() == null ? other.getOrderItemName() == null : this.getOrderItemName().equals(other.getOrderItemName()))
            && (this.getOrderItemSpecification() == null ? other.getOrderItemSpecification() == null : this.getOrderItemSpecification().equals(other.getOrderItemSpecification()))
            && (this.getOrderItemId() == null ? other.getOrderItemId() == null : this.getOrderItemId().equals(other.getOrderItemId()))
            && (this.getAcquireTime() == null ? other.getAcquireTime() == null : this.getAcquireTime().equals(other.getAcquireTime()))
            && (this.getAcquireCount() == null ? other.getAcquireCount() == null : this.getAcquireCount().equals(other.getAcquireCount()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getSourceWay() == null) ? 0 : getSourceWay().hashCode());
        result = prime * result + ((getOrderItemName() == null) ? 0 : getOrderItemName().hashCode());
        result = prime * result + ((getOrderItemSpecification() == null) ? 0 : getOrderItemSpecification().hashCode());
        result = prime * result + ((getOrderItemId() == null) ? 0 : getOrderItemId().hashCode());
        result = prime * result + ((getAcquireTime() == null) ? 0 : getAcquireTime().hashCode());
        result = prime * result + ((getAcquireCount() == null) ? 0 : getAcquireCount().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", sourceWay=").append(sourceWay);
        sb.append(", orderItemName=").append(orderItemName);
        sb.append(", orderItemSpecification=").append(orderItemSpecification);
        sb.append(", orderItemId=").append(orderItemId);
        sb.append(", acquireTime=").append(acquireTime);
        sb.append(", acquireCount=").append(acquireCount);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}